package com.lovo.order.service;

import com.lovo.common.bean.CommoditySnapshotBean;
import com.lovo.common.config.FeignConfig;
import com.lovo.common.result.GlobalHandleException;
import com.lovo.common.result.Result;
import com.lovo.order.service.impl.CommodityFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value="shop-commodity",configuration = FeignConfig.class)
public interface ICommodityService {
    @GetMapping("/commodities/{id}")
    Result getCommodityById(@PathVariable("id") Long id) throws GlobalHandleException;
    @PostMapping("/commoditySnapshots")
    Result addCommoditySnapshot(@RequestBody CommoditySnapshotBean commoditySnapshotBean) throws GlobalHandleException;
}
